package com.directv.engineertools.channelblocking

import javax.validation.constraints.AssertTrue;

import grails.test.mixin.TestFor
import spock.lang.Specification

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(Channel)
class ChannelSpec extends Specification {

    def setup() {
    }

    def cleanup() {
    }

    void "test something"() {
		def channel = Channel.create()
		channel.providerID = '234'
		channel.providerName = 'This is a long name'
		channel.effDate = Calendar.getInstance().getTime()
		channel.save()
		
		channel = Channel.create()
		channel.providerID = '345'
		channel.providerName = 'This is also not short'
		channel.save()
		
		assert Channel.longNames(10).count==1
		assert Channel.longNames(10).findByEffDateIsNotNull.providerID=='234'
    }
}
